﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace XNAGraffiti.ParticleSystems
{
    class BlueFireParticleSystem : ParticleSystem
    {
        public BlueFireParticleSystem(Game game, ContentManager content)
            : base(game, content)
        { }


        protected override void InitializeSettings(ParticleSettings settings)
        {
            settings.TextureName = "bluefire";

            settings.MaxParticles = 4000;

            settings.Duration = TimeSpan.FromSeconds(4);

            settings.DurationRandomness = 25;

            settings.MinHorizontalVelocity = 0;
            settings.MaxHorizontalVelocity = 0.45f;

            settings.MinVerticalVelocity = -0.05f;
            settings.MaxVerticalVelocity = 0.415f;

            // Set gravity upside down, so the flames will 'fall' upward.
            settings.Gravity = new Vector3(0, -0.1f, 0);

            settings.MinColor = new Color(255, 10, 10, 150);
            settings.MaxColor = new Color(255, 255, 255, 200);
            settings.MinRotateSpeed = -1;
            settings.MaxRotateSpeed = 1;
            settings.MinStartSize = 1;
            settings.MaxStartSize = 6;

            settings.MinEndSize = 6;
            settings.MaxEndSize = 8;

            // Use additive blending.
            settings.SourceBlend = Blend.SourceAlpha;
            settings.DestinationBlend = Blend.One;
        }
    }
}
